package com.lvgang.springbootrabbitmq.workqueues;

import com.lvgang.springbootrabbitmq.helloworld.HelloWorldSender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author lvgang
 */
@Component
@RabbitListener(queues = RabbitWorkQueuesConstant.QUEUQ)
public class WorkQueuesReceiver1 {
    private static Logger logger = LoggerFactory.getLogger(HelloWorldSender.class);
    @RabbitHandler
    public void process(String message) {
        logger.info("Receiver1 : " + message +","+ new Date());
    }
}